#include <stdio.h>

void insertion_sort(int arr[],int len){
        for(int i=1;i<len;i++){
                int key=arr[i];
                int j=i-1;
                while((j>=0) && (key<arr[j])){
                        arr[j+1]=arr[j];
                        j--;
                }
                arr[j+1]=key;
        }
}
int main(){
    int arr[]= { 22, 34, 3, 32, 82, 55, 89, 50, 37, 5, 64, 35, 9, 70 };
    int len=sizeof(arr)/sizeof(arr[0]);
    insertion_sort(arr,len);
    for(int i=0;i<len;i++){
            printf("%d ",arr[i]);
    }
    return 0;
}